<?php
class Core_Block_Container extends Core_Block_Abstract {

	protected function _toHtml() {
		$this->_sortChild();
		$html = '';
		foreach($this->getChild() as $c) {
			$html .= $c->getOutput();
		}
		return $html;
	}

	protected function _sortChild() {
		$order = array();
		foreach($this->getChild() as $block) {
			$order[] = $block->getOrder()===null ? 999 : (int)$block->getOrder();
		}
		array_multisort($order, SORT_ASC, $this->_childs);
	}
}